<html>
<head><meta charset="utf-8"><title>Index projection · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/Index.20projection.html">Index projection</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="213004383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/Index%20projection/near/213004383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/Index.20projection.html#213004383">(Oct 12 2020 at 07:14)</a>:</h4>
<p>For the example here: <a href="http://csclub.uwaterloo.ca/~a52arora/path-with-array-access.rs">http://csclub.uwaterloo.ca/~a52arora/path-with-array-access.rs</a>, why do we not get index projection? I'm assuming since it's an array the compiler doesn't see it as a call to a function but rather an index operation.</p>
<p><a href="http://csclub.uwaterloo.ca/~a52arora/path-with-array-access.out">http://csclub.uwaterloo.ca/~a52arora/path-with-array-access.out</a>, bottom should have what we capture (this just the use-analysis i.e. without min analysis) You can also search for "upvar borrow" to see what the delegate was called with.</p>
<p>I the case where the closure had <code>println!("{}", node2.neightbours[0])</code> I see the deref being followed by a Field projection to access neightbours but not index still</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>